package com.brother.realtime.config;

import java.text.DecimalFormat;


public class ConfigReportInterval implements Config {

	public static final String ENABLE = "123456M,"; 
	public static final String DISABLE = "123456S0"; 
	
	private String work;
	
	public String getWork() {
		return work;
	}

	public void setWork(String work) {
		this.work = work;
	}

	@Override
	public byte[] getData() {
		if(work.equalsIgnoreCase("disable")){
			return DISABLE.getBytes();
		}
		String text = "123456M,";
		DecimalFormat nf =new DecimalFormat("000");
		text = text + nf.format(interval);
		return text.getBytes();
	}
	
	private int interval = 1;

	public int getInterval() {
		return interval;
	}

	public void setInterval(int interval) {
		this.interval = interval;
	}

}
